#ifndef CPU_H
#define CPU_H
#include "mem.h"

#define ZERO_FLAG 0x80
#define CARRY_FLAG 0x10
#define HALF_FLAG 0x20
#define NEG_FLAG 0x40

class cpu {
public:
cpu(mem * m,unsigned short pc_init);
int calc_frame();
private:
void set_zero(unsigned char arg);
void set_neg(bool arg);
void set_carry(unsigned char arg1,unsigned char arg2);
void set_half(unsigned char arg);

mem * m;

bool int_enable;
unsigned short * pc;
unsigned short * af;
unsigned short * bc;
unsigned short * de;
unsigned short * hl;
unsigned short * sp;

unsigned char * a;
unsigned char * b;
unsigned char * c;
unsigned char * d;
unsigned char * e;
unsigned char * f;
unsigned char * h;
unsigned char * l;

unsigned int total_cycles;
unsigned int frame_cycles;
};
#endif
